package com.demo.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;

import com.module.commonui.R;

public class CruisePrePositionTextItem extends LinearLayout {
    private TextView tv1, tv2, tv3;
    public CruisePrePositionTextItem(Context context) {
        super(context);
        initContentView(context);
    }

    public CruisePrePositionTextItem(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public CruisePrePositionTextItem(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initContentView(context);
    }


    private void initContentView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.cruise_pre_position_info, this, true);

        tv1 = view.findViewById(R.id.tv_1);
        tv2 = view.findViewById(R.id.tv_2);
        tv3 = view.findViewById(R.id.tv_3);
    }

    public TextView getTv3(){
        return tv3;
    }

    public void setTv1(String t1){
        tv1.setText(t1);
    }

    public void setTv2(String t2){
        tv2.setText(t2);
    }

    public void setTv3(String t3){
        tv3.setText(t3);
    }

    public void setColorTv2(@ColorInt int color){
        tv2.setTextColor(color);
    }

    public void setColorTv3(@ColorInt int color){
        tv3.setTextColor(color);
    }

}
